﻿@{
    ViewBag.Title = "RefundDetailConfirmForm";
    Layout = "~/Views/Shared/_Form.cshtml";
}

<form name="form1">
    <div style="padding-top: 4%;padding-left:10%;">
        <table class="form" id="tr_detail">
            <tr>
                <th class="formValue">项目名称</th>
                <th class="formValue">单价</th>
                <th class="formValue">退数量</th>
                <th class="formValue">退金额</th>
            </tr>
        </table>
        <div style="font-size:larger;position:fixed;bottom:50px;">
            <label>总计：</label><label style="color:red;">￥&nbsp;</label><label style="color:red;" id="zje"></label>
        </div>
    </div>
</form>
<script>
    $(function () {
        //浏览器窗口调整大小时重新加载jqGrid的宽
        $(window).resize(function () {
            initLayout("MyTabGrid");
        });

        var data = localStorage.getItem("needRefundData");
        if (!data) {
            return;
        }
        var needRefundData = JSON.parse(data);
        var zje = 0;
        for (var i = 0; i < needRefundData.length; i++) {
            var je = roundingBy4she6ru5chengshuang((parseFloat(needRefundData[i].dj) * parseFloat(needRefundData[i].tsl)), 2);
            $('#tr_detail').append('<tr><td class="formValue"> <label >' + needRefundData[i].sfxmmc + '</label></td><td class="formValue"> <label >' + needRefundData[i].dj + '</label></td><td class="formValue"> <label >' + needRefundData[i].tsl + '</label></td><td class="formValue"> <label >' + je + '</label></td></tr>');

            //计算金额
            zje = roundingBy4she6ru5chengshuang((parseFloat(zje) + parseFloat(je)),2);
        }
        $('#zje').text(zje);
        $('#zje').addClass('moneybg');

    })

</script>
